package com.youhong.teethcare.utils

import com.youhong.teethcare.R
import com.youhong.teethcare.javabeans.BrushingRecord

fun getArea(area1:Byte, area2:Byte, area3:Byte,
            area4:Byte, area5:Byte, area6:Byte) :ArrayList<Int>{

    var cleanList = ArrayList<Int>();
    initArea1(area1.toInt(),cleanList)
    initArea2(area2.toInt(),cleanList)
    initArea3(area3.toInt(),cleanList)
    initArea4(area4.toInt(),cleanList)
    initArea5(area5.toInt(),cleanList)
    initArea6(area6.toInt(),cleanList)
    return cleanList;
}
fun initArea1(area1:Int,cleanList:ArrayList<Int>){
    when(area1){
        1->{
            cleanList.add(R.drawable.brush_realtime_bottom_bottom)
        }
        4->{cleanList.add(R.drawable.brush_realtime_bottom_top)}
        5->{
            cleanList.add(R.drawable.brush_realtime_bottom_top)
            cleanList.add(R.drawable.brush_realtime_bottom_bottom)
        }
    }
}
fun initArea2(area1:Int,cleanList:ArrayList<Int>){
    when(area1){
        1->{
            cleanList.add(R.drawable.brush_realtime_top_top)
        }
        4->{cleanList.add(R.drawable.brush_realtime_top_bottom)}
        5->{
            cleanList.add(R.drawable.brush_realtime_top_top)
            cleanList.add(R.drawable.brush_realtime_top_bottom)
        }
    }
}
fun initArea3(area1:Int,cleanList:ArrayList<Int>){
    when(area1){

        1->{
            cleanList.add(R.drawable.brush_realtime_leftbottom_left)
        }
        2->{
            cleanList.add(R.drawable.brush_realtime_leftbottom_middle)
        }
        3->{
            cleanList.add(R.drawable.brush_realtime_leftbottom_left)
            cleanList.add(R.drawable.brush_realtime_leftbottom_middle)
        }

        4->{  cleanList.add(R.drawable.brush_realtime_leftbottom_right)}
        5->{
            cleanList.add(R.drawable.brush_realtime_leftbottom_left)
            cleanList.add(R.drawable.brush_realtime_leftbottom_right)
        }
        6->{
            cleanList.add(R.drawable.brush_realtime_leftbottom_middle)
            cleanList.add(R.drawable.brush_realtime_leftbottom_right)
        }
        7->{
            cleanList.add(R.drawable.brush_realtime_leftbottom_left)
            cleanList.add(R.drawable.brush_realtime_leftbottom_middle)
            cleanList.add(R.drawable.brush_realtime_leftbottom_right)
        }
    }
}
fun initArea4(area1:Int,cleanList:ArrayList<Int>){
    when(area1){

        1->{
            cleanList.add(R.drawable.brush_realtime_lefttop_left)
        }
        2->{
            cleanList.add(R.drawable.brush_realtime_lefttop_middle)
        }
        3->{
            cleanList.add(R.drawable.brush_realtime_lefttop_left)
            cleanList.add(R.drawable.brush_realtime_lefttop_middle)
        }

        4->{  cleanList.add(R.drawable.brush_realtime_lefttop_right)}
        5->{
            cleanList.add(R.drawable.brush_realtime_lefttop_left)
            cleanList.add(R.drawable.brush_realtime_lefttop_right)
        }
        6->{
            cleanList.add(R.drawable.brush_realtime_lefttop_middle)
            cleanList.add(R.drawable.brush_realtime_lefttop_right)
        }
        7->{
            cleanList.add(R.drawable.brush_realtime_lefttop_left)
            cleanList.add(R.drawable.brush_realtime_lefttop_middle)
            cleanList.add(R.drawable.brush_realtime_lefttop_right)
        }
    }
}
fun initArea5(area1:Int,cleanList:ArrayList<Int>){
    when(area1){
        1->{
            cleanList.add(R.drawable.brush_realtime_rightbottom_right)
        }
        2->{
            cleanList.add(R.drawable.brush_realtime_rightbottom_middle)
        }
        3->{
            cleanList.add(R.drawable.brush_realtime_rightbottom_right)
            cleanList.add(R.drawable.brush_realtime_rightbottom_middle)
        }

        4->{  cleanList.add(R.drawable.brush_realtime_rightbottom_left)}
        5->{
            cleanList.add(R.drawable.brush_realtime_rightbottom_right)
            cleanList.add(R.drawable.brush_realtime_rightbottom_left)
        }
        6->{
            cleanList.add(R.drawable.brush_realtime_rightbottom_left)
            cleanList.add(R.drawable.brush_realtime_rightbottom_middle)
        }
        7->{
            cleanList.add(R.drawable.brush_realtime_rightbottom_left)
            cleanList.add(R.drawable.brush_realtime_rightbottom_middle)
            cleanList.add(R.drawable.brush_realtime_rightbottom_right)
        }
    }
}
fun initArea6(area1:Int,cleanList:ArrayList<Int>){
    when(area1){
        1->{
            cleanList.add(R.drawable.brush_realtime_righttop_right)
        }
        2->{
            cleanList.add(R.drawable.brush_realtime_righttop_middle)
        }
        3->{
            cleanList.add(R.drawable.brush_realtime_righttop_right)
            cleanList.add(R.drawable.brush_realtime_righttop_middle)
        }
        4->{  cleanList.add(R.drawable.brush_realtime_righttop_left)}
        5->{
            cleanList.add(R.drawable.brush_realtime_righttop_right)
            cleanList.add(R.drawable.brush_realtime_righttop_left)
        }
        6->{
            cleanList.add(R.drawable.brush_realtime_righttop_left)
            cleanList.add(R.drawable.brush_realtime_righttop_middle)
        }
        7->{
            cleanList.add(R.drawable.brush_realtime_righttop_right)
            cleanList.add(R.drawable.brush_realtime_righttop_middle)
            cleanList.add(R.drawable.brush_realtime_righttop_left)
        }
    }
}